<!DOCTYPE html>
<html>
<head>
    <title>缴款记录查看</title>
<#include "../common/common.ftl"/>
</head
<body>
<div class="layui-fluid">
    <input type="hidden" name="contractId" value="${(contract.id)!}"/>

    <blockquote class="layui-elem-quote layui-bg-white">
        缴款信息查看
        【姓名：<span class="jmdf-color-red">${(contract.name)!}</span>】
        【协议编号：<span class="jmdf-color-red">${(contract.contractCode)!}</span>】
        【房屋应缴款：<span class="jmdf-color-red">${bigUtils.getAbsolute(houseYjMoney)}元</span>】
        【公维金应缴款：<span class="jmdf-color-red">${bigUtils.getAbsolute(contract.zzwxMoney)}元</span>】
        <br/>


    <#if cwMemoMap??>
        <span class="jmdf-color-red" style="font-size: 20px">
        ${cwMemoMap['cwQiHouseMemo']!}<br/>
        ${cwMemoMap['cwQiCarLotMemo']!}
        </span>
    </#if>
    </blockquote>

    <div class="layui-row layui-col-space10">
        <div class="layui-col-xs12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <table id="dataTable" class="layui-table" lay-filter="layFilter"></table>
                    <!--序号-->
                    <script type="text/html" id="indexTpl">
                        {{d.LAY_TABLE_INDEX+1}}
                    </script>
                    <!--菜单-->
                    <script type="text/html" id="dataTable_toolbar">
                        {{# if(d.LAY_TABLE_INDEX != d.size){ }}
                        <a class="layui-btn layui-btn-xs jmdf-btn-edit" lay-event="dataTable_edit"><i
                                class="layui-icon layui-icon-edit"></i>修改</a>
                        <a class="layui-btn layui-btn-xs jmdf-btn-delete" lay-event="dataTable_delete"><i
                                class="layui-icon layui-icon-delete"></i>删除</a>
                        {{#  } }}
                    </script>
                    <!-- 表格头部工具栏 -->
                    <script type="text/html" id="toolbar">
                        <div class="layui-btn-container right">
                            <button lay-event="reload" class="layui-btn layui-btn-sm"><i
                                    class="layui-icon layui-icon-refresh"></i>重载
                            </button>
                            <button lay-event="add" class="layui-btn layui-btn-sm"><i
                                    class="layui-icon layui-icon-add-circle"></i>登记缴款信息
                            </button>
                        </div>
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/layui/layui.js" charset="utf-8"></script>
<script>
    layui.config({
        base: '/modules/' //静态资源所在路径
    }).use(['table', 'form', 'jquery', 'jmdf', 'page', 'dataDict'], function () {
        var $ = layui.jquery, jmdf = layui.jmdf, page = layui.page, table = layui.table, form = layui.form, dataDict = layui.dataDict;

        form.render();
        /***********************table表格相关操作 start*************************/
        var tableRenderId = "renderId";
        var tableId = "dataTable";
        var table_layFilter = "layFilter";
        var tableUrl = "loadHandInMoneyRecord?contractId=${(contract.id)!}";

        //列项内容
        var cols = [[
            {title: "序号", toolbar: '#indexTpl', type: "numbers", fixed: 'left', align: 'center', width: 50}
            , {field: "handInMoneyDate", title: "缴款时间", align: 'center', minWidth: 100}
            , {
                field: "handInMoneyTypeStr",
                title: "缴款类别",
                align: 'center',
                minWidth: 100,
                unresize: true,
                sort: true,
                totalRowText: '合计缴款'
            }
            , {field: "handInMoney", title: "缴款金额", align: 'center', minWidth: 80, totalRow: true}
            , {field: "handInMoneyMemo", title: "缴款备注", align: 'center', minWidth: 100}
            , {title: '操作', fixed: 'right', align: 'center', toolbar: '#dataTable_toolbar', width: 220}
        ]];
        //table设置项
        var options = {
            elem: '#' + tableId//table列表id值
            , url: tableUrl
            , toolbar: '#toolbar'//自定义工具栏
            , cols: cols
            , id: tableRenderId
            , totalRow: true
            , defaultToolbar: ['filter', 'print']//显示列、打印
            , autoSort: false //禁用前端自动排序。
        };

        //初始表格（含分页设置）
        page.render(options);
        //表格排序
        page.sort(tableId, tableRenderId);
        //刷新当前页方法封装
        page.reload();

        //分页查询（查询条件）
        $("#searchButton").click(function () {
            page.search("searchForm", tableRenderId);
        });

        //头工具栏事件
        table.on('toolbar(' + table_layFilter + ')', function (obj) {
            switch (obj.event) {
                case 'reload':
                    loadData();
                    break;
                case 'add':
                    jmdf.form("handInMoney?contractId=" + ${(contract.id)!"0"});
                    break;
            }
        });

        table.on("tool(" + table_layFilter + ")", function (obj) {
            var data = obj.data;///获得当前行数据
            var layEvent = obj.event;//获得lay-event对应的值
            var id = data["id"];
            if (layEvent == "dataTable_edit") {
                jmdf.form("handInMoney?contractId=${(contract.id)!}&handInMoneyId=" + id, "60")
            } else if (layEvent == "dataTable_delete") {
                jmdf.del("delHandInMoneyById?handInMoneyId=" + id);
            }
        });

    });
</script>
</body>
</html>